<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>父节点</title>
</head>

<body>
  <div class="yeye">
    <div class="fa">
      <div class="son"></div>
    </div>
  </div>
  <script>
    // 查找最近一级的父亲节点,返回一个对象,找不到返回null
    const son = document.querySelector('.son')
    console.log(son);  //儿子节点
    console.log(son.parentNode);  //父亲节点
    console.log(son.parentNode.parentNode);  //爷爷节点
  </script>
</body>

</html>